package Storage;

import android.location.Location;

import com.google.android.maps.GeoPoint;

public class Buddy {
	private Location location;
	private String FirstName;
	private String LastName;
	private String PhoneNumber;
	private String LastUpdate;
	private String LastSeen;
	private String IsOnline;
	private String address;
	private String email;

	public Location getLocation() {
		return this.location;
	}
	
	public String getPhoneNumber() {
		return this.PhoneNumber;
	}
	public String getAddress() {
		return this.address;
	}
	public String getEmail() {
		return this.email;
	}

	public String getLastUpdate() {
		return this.LastUpdate;
	}
	public String getLastSeen() {
		return this.LastSeen;
	}

	public String getIsOnline() {
		return this.IsOnline;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	public void setFname(String firstname) {
		this.FirstName = firstname;
	}

	public void setLname(String lastname) {
		this.LastName = lastname;
	}

	public void setPhoneNumber(String phonenumber) {
		this.PhoneNumber = phonenumber;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	public void setEmail(String email) {
		this.email = email;
	}

	public void setLastUpdate(String lastupdate) {
		this.LastUpdate = lastupdate;
	}
	public void setLastSeen(String lastseen) {
		this.LastSeen = lastseen;
	}

	public void setIsOnline(String isOnline) {
		this.IsOnline = isOnline;
	}

	public GeoPoint getGeoPoint() {

		Double latitude = this.location.getLatitude() * 1e6;
		Double longitude = this.location.getLongitude() * 1e6;
		return (new GeoPoint(latitude.intValue(), longitude.intValue()));
	}
	public String getFname() {
		return this.FirstName;
	}
	public String getFullName() {
		String details="";
		details += this.FirstName+" "+ this.LastName;
		return details;
	}
	private String getStatusText()
	{
		String status="";
		if(this.IsOnline.equals("1"))
			status = "Online";
		if(this.IsOnline.equals("0"))
			status = "Offline";
		return status;
	}
	
	public String getAllDetails() {
		String details="";
		details = details + "* Status: " + getStatusText()+"\n";
		details = details + "* Phone No: "+ getPhoneNumber()+"\n";
		details = details + "* Address: "+ getAddress()+"\n";
		details = details + "* Email: "+ getEmail()+"\n";
		details = details + "* LastUpdate: "+ getLastUpdate()+"\n";
		return details;
	}

}
